Carbon


TrackWindowProxyFromExistingDrag

Header: MacWindows.h Carbon status: Supported

Allows custom handling of the drag process when the user drags a proxy icon.

OSStatus TrackWindowProxyFromExistingDrag (
    WindowRef window, 
    Point startPt, 
    DragReference drag, 
     inDragOutlineRgn
);
window

A pointer to the window whose proxy icon is being dragged.

startPt

Set the Point structure to contain the point, specified in global coordinates, where the mouse-down event that began the drag occurred. Your application may retrieve this value from the where field of the event structure.

drag

A value that refers to the current drag process. Pass in the value produced in the outNewDrag parameter of the function BeginWindowProxyDrag. If you are not using BeginWindowProxyDrag in conjunction with TrackWindowProxyFromExistingDrag, you must create the drag reference yourself with the Drag Manager function NewDrag.

inDragOutlineRgn

A region handle representing an outline of the icon being dragged. You may obtain a handle to this region from the outDragOutlineRgn parameter of BeginWindowProxyDrag. If you are not using BeginWindowProxyDrag in conjunction with TrackWindowProxyFromExistingDrag, you must create the region yourself.

function result

A result code. Errors are also returned from the Drag Manager, including userCanceledErr (-128).

DISCUSSION

Typically, if the proxy icon represents a type of object (currently, file system entities such as files, folders, and volumes) supported by the Window Manager, the Window Manager can handle all aspects of the drag process itself, and your application should call the function TrackWindowProxyDrag. However, if the proxy icon represents a type of data that the Window Manager does not support, or if you wish to implement custom dragging behavior, your application should call the TrackWindowProxyFromExistingDrag function.

The TrackWindowProxyFromExistingDrag function accepts an existing drag reference and adds file data if the window contains a file proxy. If your application uses TrackWindowProxyFromExistingDrag, you then have the choice of using this function in conjunction with the functions BeginWindowProxyDrag and EndWindowProxyDrag or simply calling TrackWindowProxyFromExistingDrag and handling all aspects of creating and disposing of the drag yourself.

Your application detects a drag when the function FindWindow returns the inProxyIcon result code; see “FindWindow Result Code Constant for the Proxy Icon” for more details.

VERSION NOTES

This function is available with Mac OS 8.5 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when WindowsLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by WindowsLib 8.5 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)